#include "eventtype.h"

// 手机验证码响应代码对应的描述
static EErrorReason EER[] =
{
	{ERRC_SUCCESS ,"Ok."},
	{ERRC_INVALID_MSG ,"invalid message."},
	{ERRC_INVALID_MSG ,"Invalid data."},
	{ERRC_METHOD_NOT_ALLOWED ,"Method not allowed."},
	{ERRC_PROCCESS_FALIED ,"Proccess failed."},
	{ERRC_BIKE_IS_TOOK , "bike is took."},
	{ERRC_BIKE_RUNNING , "bike is runing."},
	{ERRC_BIKE_IS_DAMGED , "bike is damaged."},
	{ERR_NULL , "Undefined."}
};

const char* getReasonByErrorCode(i32 code) {
	i32 i = 0;
	for (i = 0; EER[i].code != ERR_NULL; i++) {
		if (EER[i].code == code) {
			return EER[i].reason;
		}
	}
	return EER[i].reason;
}